<template>
	<view class="box">
		<view class="context">
			<view class="details" v-if="doctors.is_status == '1' || doctors.is_status == '2'">
				<view class="uname">
					<text>姓&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;名:</text>
					<text>{{doctors.user_name}}</text>
				</view>
				<view class="title">
					<text>职&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;称:</text>
					<text>{{doctors.holder}}</text>
				</view>
				<view class="education">
					<text>学&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;历:</text>
					<text>{{doctors.record}}</text>
				</view>
				<view class="graduateSchool">
					<text>毕业院校:</text>
					<text>{{doctors.school_title}}</text>
				</view>
				<view class="birth">
					<text>出生年月:</text>
					<text>{{doctors.date_time}}</text>
				</view>
				<view class="certificate">
					<text class="certificateImg">职业证书:</text>
					<image v-for="(item,index) in certificate" :key="index" :src="item" mode="scaleToFill" style="width: 100rpx; height: 100rpx;"></image>
				</view>
				<view class="personal">
					<text>个人介绍:</text>
					<text>{{doctors.referral}}</text>
				</view>
			</view>

			<view class="examine" v-if="doctors.is_status == '2'">
				<text @click="examine">通过审核</text>
				<text @click="reject">驳回</text>
			</view>

		</view>
	</view>
</template>

<script>
	export default {
		async onLoad(options) {
			this.doctors = JSON.parse(decodeURIComponent(options.doctorsdatas));
			console.log(this.doctors);
			// 职业证书
			this.certificate = this.doctors.creden.split(",");
		},
		data() {
			return {
				doctors: null,
				certificate: null
			};
		},
		methods: {
			doctorManagement() {
				uni.navigateTo({
					url: "../doctorManagement1/doctorManagement1"
				})
			},

			examine() {
				let ids = this.doctors.id;
				console.log(ids);
				uni.request({
					url: "https://chat.assessgeek.com/api/Mianpage/getCheck",
					method: "POST",
					data: {
						id: ids,
						status: 1,
						content: ""
					},
					success: (res) => {
						uni.navigateTo({
							url: "../doctorManagement1/doctorManagement1"
						})
					}
				});

			},


			reject() {
				console.log(this.doctors.id);
				uni.navigateTo({
					url: `../failed5/failed5?id=${this.doctors.id}`
				})
			},
		}
	}
</script>

<style lang="scss">
	.context {

		.details {
			width: calc(100vw - 100rpx);
			margin: 10rpx auto;

			>view {
				text {
					color: RGBA(50, 51, 50, 1);

					&:first-of-type {
						margin-right: 70rpx;
						color: RGBA(153, 153, 153, 1);
					}
				}
			}


			.certificate,
			.personal {
				text {
					&:first-of-type {
						display: inline-block;
						width: 100%;
					}
				}
			}


			.certificate {
				image {
					&:not(:first-of-type) {
						margin-left: 20rpx;
					}
				}
			}
		}

		.examine {
			width: $calcWidth;
			height: 120rpx;
			position: fixed;
			left: 50%;
			bottom: 50rpx;
			z-index: 100;
			transform: translateX(-50%);
			display: flex;
			justify-content: space-between;
			align-items: center;
			color: rgba(255, 255, 255, 1);

			>text {
				display: inline-block;
				width: 46%;
				height: 80rpx;
				line-height: 80rpx;
				text-align: center;
				border-radius: 50rpx;
				font-size: 32rpx;
				font-weight: bold;
				letter-spacing: 10rpx;

				&:first-of-type {
					background-color: RGBA(0, 211, 192, 1);
				}

				&:last-of-type {
					background-color: RGBA(255, 127, 101, 1);
				}
			}
		}
	}

	.certificateImg {
		margin-bottom: 20rpx;
	}
</style>
